from flask_marshmallow import base_fields
from flask_restplus_patched import ModelSchema
from app.modules.common.schemas import BaseSchema


class LoadLevelBaseSchema(ModelSchema):
    class Meta:
        fields = (
            "id",
            "level_name",
            "cpus",
            "ram",
            "disks",
            "desc",
            "scale",
        )

        dump_only = (
            "id",
        )


class LoadLevelListSchema(BaseSchema):
    data = base_fields.Nested(
        LoadLevelBaseSchema,
        many = True
    )

    class Meta:
        fields = BaseSchema.Meta.fields + (
            'data',
        )
